<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录页</title>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $("#submit").click(function(){
                $.ajax({
                    type:"post",
                    url:"http://localhost:8080/login",
                    data:{
                        "username":$("#username").val(),
                        "password":$("#password").val()
                    },
                    success:function(r){
                        location.href = 'http://localhost:8080/index';
                    },
                    error:function () {
                        alert(2);
                    }
                })
            })
        })
    </script>
</head>
<body>
    <form id="loginForm">
        用户名：<input type="text" id="username" name="username" value=""/><br/>
        密&nbsp;码<input type="text" id="password" name="password" value=""/><br/>
        <input id="submit" type="button" value="登录"/>
    </form>
<table>

</table>
</body>
</html>